package room;

/**
 * 
 * Connects a room with another room or a corridor
 * 
 * @author Gasparen
 *
 */

public class Door 
{
	private Room room1;
	private Room room2;
	private boolean locked;
	
	public Door(Room room1, Room room2)
	{
		this.room1 = room1;
		this.room2 = room2;
	}
	
	public void lock()
	{
		this.locked = true;
	}
	
	public void unlock()
	{
		this.locked = false;
	}
	
	/**
	 * @return true or false;
	 */
	public boolean isLocked()
	{
		return this.locked;
	}
	
	public Room getRoom1()
	{
		return this.room1;		
	}
	
	public Room getRoom2()
	{
		return this.room2;		
	}
}
